<%@ page language="java" import="java.util.*, user.Customer" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%
	String regName = session.getAttribute("username").toString(); 
	Customer customer = Customer.profile(regName);
	if (customer == null)
		System.out.println("ERROR");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'profile.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>

<div align="center">
  <table width="300" border="0">
    <tr>
      <td>Profile</td>
    </tr>
    <tr>
      <td><div>
        <form id="profile" name="profile" method="post" action="./servlet/ProfileManagement">
          <div><table width="300" border="0">
  <tr>
    <td width="125">Register Name:</td>
    <td width="165"><label>
      <input name="register_name" type="text" disabled="disabled" id="register_name" <%= "value=\"" + customer.getRegName() + "\"" %> />
    </label></td>
  </tr>
  <tr>
    <td>Real Name:</td>
    <td><label>
      <input type="text" name="real_name" id="real_name" <%= "value=\"" + customer.getRealName() + "\"" %> />
    </label></td>
  </tr>
  <tr>
    <td>Address:</td>
    <td><label>
      <input type="text" name="address" id="address" <%= "value=\"" + customer.getAddress() + "\"" %> />
    </label></td>
  </tr>
  <tr>
    <td>Phone:</td>
    <td><label>
      <input type="text" name="phone" id="phone" <%= "value=\"" + customer.getPhone() + "\"" %> />
    </label></td>
  </tr>
  <tr>
    <td>Email:</td>
    <td><label>
      <input type="text" name="email" id="email" <%= "value=\"" + customer.getEmail() + "\"" %> />
    </label></td>
  </tr>
</table>
</div>

<div align="center"><input name="update" type="submit" value="Update" />&nbsp;&nbsp;<input name="reset" type="reset" value=" Reset" /></div>
      
</form>
      </div></td>
    </tr>
  </table>
</div>

</body>
</html>
